﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ComicBook.Data.IDataAdapters.Interfaces;
using ComicBook.Data.IDataAdapters.Adapters;
using ComicBook.DataModels;

namespace ComicBook.web.Controllers
{
    public class HomeController : Controller
    {
        IComicBookAdapter _adapter;
        public HomeController()
        {
            _adapter = new ComicBookAdapter();
        }
        public HomeController(IComicBookAdapter adapter)
        {
            _adapter = adapter;
        }
        public ActionResult Index()
        {
            List<Comic> comics = _adapter.GetAllComics();
            return View(comics);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}